<?php

$isLocalhost = ('127.0.0.1' === $_SERVER['REMOTE_ADDR'] || '::1' === $_SERVER['REMOTE_ADDR']);

if ($isLocalhost) {
    error_reporting(E_ALL | E_STRICT);
	ini_set('display_errors', 1);
} else {
    error_reporting(E_ALL ^ E_NOTICE);
}

if (!ini_get('date.timezone')) {
    date_default_timezone_set('Asia/Saigon');
}

if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value)
    {
        $value = is_array($value) ?
                    array_map('stripslashes_deep', $value) :
                    stripslashes($value);

        return $value;
    }

    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
    $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}

Fete_Registry::getInstance()->set('FETE_ENV', 'development');
